# coding: utf-8
import uiautomator2 as u2
from time import sleep

d = u2.connect("6d5b932e")
d.implicitly_wait(120)
name_wx='mojin20220113'
d.app_start('com.tencent.mm',stop=True,wait=True)

while not d.xpath('//*[@resource-id="com.tencent.mm:id/gsl"]/android.widget.ImageView[1]').exists:
    break

d.xpath('//*[@resource-id="com.tencent.mm:id/gsl"]/android.widget.ImageView[1]').click()#点击搜索
d(resourceId="com.tencent.mm:id/cd7").send_keys(name_wx)#输入微信号
d(text='微信号: %s'%name_wx).click()#点击搜索的人员
d.xpath('//android.widget.EditText').set_text('55')
d(resourceId="com.tencent.mm:id/b8k").click()